﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Optimization;
using System.Web.Routing;
using System.Web.Security;
using OnlineBusinesses;
using FAMailUtils;
using famails.common;

namespace OnlineBusinesses
{
    public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {

            log4net.Config.XmlConfigurator.Configure();
            ConnectionData._ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
            ConnectionData.AddNewConnection();
            ConnectionData.OpenMyConnection();
            // Code that runs on application startup
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterOpenAuth();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }

        void Application_End(object sender, EventArgs e)
        {
            //  Code that runs on application shutdown

        }

        void Application_Error(object sender, EventArgs e)
        {
            FAMailUtils.Common.logs(sender + "-" + e.ToString(), null, FAMailUtils.Common.logType.info);

        }
    }
}
